<template>
  <div>
    <DictGroupComponent ref="dictGroup1">
      <DictDefineComponent dict-group="A02"/>
      <DictDefineComponent dict-group="A01"/>
      <DictDefineComponent dict-group="A05"/>
    </DictGroupComponent>
    <ButtonBarRowComponent>
      <Button text="打开弹出框" :click-function="openMessageWin"/>
      <Button text="打开意见框" :click-function="operConfirmWin"/>
      <Button text="打开输入框" :click-function="openFormWin"/>
      <Button text="获取输入框值" :click-function="getFormValue"/>
      <Button text="获取字典值" :click-function="getDictKey"/>
    </ButtonBarRowComponent>
    <ToolBarComponent ref="queryForm">
      <QueryBarComponent row-num="1">
        <InputComponent input-lable="测试条件1" input-name="test1" input-type="text"/>
        <InputComponent input-lable="测试条件1" input-name="test2" input-type="text"/>
        <InputComponent input-lable="测试条件1" input-name="test3" input-type="text"/>
        <InputComponent input-lable="测试条件1" input-name="test4" input-type="text"/>
      </QueryBarComponent>
      <QueryBarComponent row-num="2">
        <InputComponent input-lable="测试条件2" input-name="test5" input-type="text"/>
        <InputComponent input-lable="测试条件2" input-name="test6" input-type="text"/>
        <InputComponent input-lable="测试条件2" input-name="test7" input-type="text"/>
        <InputComponent input-lable="测试条件2" input-name="test8" input-type="text"/>
        <NumberInputComponent input-lable="数字条件3" input-name="test9"/>
        <SelectComboComponent ref="combo" input-lable="测试" input-name="test11" group-code="A01"/>
      </QueryBarComponent>
      <QueryBarComponent row-num="3">
        <RadioGroupComponent radio-group-item="单选条件4" radio-group-name="test10">
          <RedioComponent radio-item="条件1" radio-value="1"/>
          <RedioComponent radio-item="条件2" radio-value="2"/>
          <RedioComponent radio-item="条件3" radio-value="3"/>
          <RedioComponent radio-item="条件4" radio-value="4"/>
          <RedioComponent radio-item="条件5" radio-value="5"/>
        </RadioGroupComponent>
      </QueryBarComponent>
      <Button text="查询" :click-function="getFormData"/>
    </ToolBarComponent>
    <MessageWinComponent ref="message" message="测试弹出框"/>
    <MessageConfirmComponent ref="messageConfirm" message="测试选择框" :refuse-function="refuse" :sure-function="sure"/>
    <FormWin ref="form" :refuse-function="refuse" :sure-function="sure">
      <InputComponent input-lable="输入1" input-name="input1" input-type="text"/>
    </FormWin>
    <GridComponent
        ref="queryGrid"
        load-url="manage/sequeuce/querySeque.do"
        :paging-moduel="true"
        select-moduel="single"
        :auto-load="false"
        grid-name="sequeuceGrid"
    >
      <GridColumnComponent index-name="sequeuceName" column-name="序列名称" width="150px"></GridColumnComponent>
      <GridColumnComponent index-name="initVal" column-name="序列起点" width="150px"></GridColumnComponent>
      <GridColumnComponent index-name="currentVal" column-name="序列当前值" width="150px"></GridColumnComponent>
      <GridColumnComponent index-name="step" column-name="序列增长步长" width="150px"></GridColumnComponent>
    </GridComponent>
  </div>
</template>

<script>
import ToolBarComponent from "@/components/toolbar/ToolBarComponent";
import QueryBarComponent from "@/components/toolbar/QueryBarComponent";
import InputComponent from "@/components/input/InputComponent";
import Button from "@/components/button/ButtonComponent";
import NumberInputComponent from "@/components/input/NumberInputComponent";
import RadioGroupComponent from "@/components/input/RadioGroupComponent";
import RedioComponent from "@/components/input/RedioComponent";
import SelectComboComponent from "@/components/input/SelectComboComponent";
import GridColumnComponent from "@/components/grid/GridColumnComponent";
import GridComponent from "@/components/grid/GridComponent";
import ButtonBarRowComponent from "@/components/button/ButtonBarRowComponent";
import MessageWinComponent from "@/components/win/MessageWinComponent";
import MessageConfirmComponent from "@/components/win/MessageConfirmComponent";
import FormWin from "@/components/win/FormWin";
import DictGroupComponent from "@/components/dict/DictGroupComponent";
import DictDefineComponent from "@/components/dict/DictDefineComponent";

export default {
  name: "TestPage",
  data(){
    return{
      comboData:new Map
    }
  },
  components: {
    DictDefineComponent,
    DictGroupComponent,
    FormWin,
    MessageConfirmComponent,
    MessageWinComponent,
    ButtonBarRowComponent,
    GridComponent,
    GridColumnComponent,
    SelectComboComponent,
    RedioComponent,
    RadioGroupComponent, NumberInputComponent, Button, InputComponent, QueryBarComponent, ToolBarComponent},
  methods:{
    openFormWin:function (){
      this.$refs["form"].showWin();
    },
    getFormData:function (){
      let param = this.$refs["queryForm"].getSubmitParams();
    },
    operConfirmWin(){
      this.$refs["messageConfirm"].showWin();
    },
    openMessageWin(){
      this.$refs["message"].showWin();
    },
    sure(){
      console.log("同意");
    },
    refuse(){
      console.log("拒绝");
    },
    getFormValue(){
      console.log(this.$refs["form"].getValues());
    },
    getDictKey(){
      console.log(this.$refs["dictGroup1"].getDict("A2"));
    }
  },
  mounted() {

  }
}
</script>

<style scoped>

</style>